
#ifndef  _RADIX_ARCHAISM_WINODW_H_
#define  _RADIX_ARCHAISM_WINODW_H_

#include <Archaism/Header.h>
#include <Archaism/Signal.h>

_BeginNamespace(Radix)

class Window
{
	_ForbidCopy(Window);
	_ForbidAssign(Window);

public:
	Window(const String& text, int width, int height, bool isFullScreen = false);
	virtual ~Window();

public:
	uint windowHandle() const;
	const String& text() const;
	void setText(const String& text);
	bool visible() const;
	void setVisible(bool visible);
	bool fullScreen() const;
	void setFullScreen(bool isFullScreen);
	int x() const;
	int y() const;
	void setLocation(int x, int y);
	int width() const;
	int height() const;
	void setSize(int w, int h);
	void center();
	void show();
	void hide();
	void close();

public:
	struct ActionSignalMessage
	{
		Window* window;
	};
	Signal<ActionSignalMessage&> onCreate;
	Signal<ActionSignalMessage&> onMaximize;
	Signal<ActionSignalMessage&> onMinimize;
	Signal<ActionSignalMessage&> onDestroy;

	struct ResizeSignalMessage
	{
		Window* window;
		int width, height;
	};
	Signal<ResizeSignalMessage&> onResize;

	struct MoveSignalMessage
	{
		Window* window;
		int x, y;
	};
	Signal<MoveSignalMessage&> onMove;

	struct CloseSignalMessage
	{
		Window* window;
		bool cancel;
	};
	Signal<CloseSignalMessage&> onClose;

private:
	struct WindowAttribute* mAttribute;
};

_EndNamespace(Radix)

#endif//_RADIX_ARCHAISM_WINODW_H_
